package com.jc.business.user;

import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jc.business.base.BaseBusiness;
import com.jc.ds.model.User;
import com.jc.service.user.UserService;

@Service
public class UserBusiness extends BaseBusiness {
		
	@Autowired
	UserService userService;
	
	public User findByUserName(String userName) {
		
		//这个地方后面可以进行优化从REDIS里面取
		User u = new User();
		u.setUserName(userName);
		List<User> ulist = userService.queryAll(u);
		if(CollectionUtils.isNotEmpty(ulist)) {
			return ulist.get(0);
		}
		return null;
	}

}
